home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 3.2 KB | 100 lines | [TEXT/MPS ] |
- {
- File: MemAllocators.p
-
- Version: Technology:
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- }
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT MemAllocators;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED __MEMALLOCATORS__}
- {$SETC __MEMALLOCATORS__ := 1}
-
- {$I+}
- {$SETC MemAllocatorsIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
- {$IFC UNDEFINED __TYPES__}
- {$I Types.p}
- {$ENDC}
- {$IFC UNDEFINED __MIXEDMODE__}
- {$I MixedMode.p}
- {$ENDC}
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- {$IFC FOR_SYSTEM8_PREEMPTIVE }
- {
- * NOTE: Callers of the MemAllocators API are gauranteed at least
- * kMemAllocatorAlignment_Minimum alignment of all allocated blocks.
- }
-
- CONST
- kMemAllocatorAlignment_Minimum = 2; { (4 Byte Alignment Gaurantee) }
-
-
- TYPE
- MemAllocatorRef = ^LONGINT;
- {
- * Handle support
- }
- FUNCTION MemNewHandle(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outHandle: Handle): OSStatus; C;
- FUNCTION MemNewHandleClear(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outHandle: Handle): OSStatus; C;
- FUNCTION MemDisposeHandle(VAR ioHandle: Handle): OSStatus; C;
- FUNCTION MemSizeHandle(inSize: ByteCount; inHandle: Handle): OSStatus; C;
- FUNCTION MemGetHandleSize(inHandle: Handle; VAR outSize: ByteCount): OSStatus; C;
- {
- * Fixed block support
- }
- FUNCTION MemNewFixed(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
- FUNCTION MemNewFixedClear(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
- { inAlignment must be in the range 0..31 }
- FUNCTION MemNewFixedAligned(inAllocator: MemAllocatorRef; inSize: ByteCount; inAlignment: UInt32; VAR outMemory: UNIV Ptr): OSStatus; C;
- { inAlignment must be in the range 0..31 }
- FUNCTION MemNewFixedAlignedClear(inAllocator: MemAllocatorRef; inSize: ByteCount; inAlignment: UInt32; VAR outMemory: UNIV Ptr): OSStatus; C;
- FUNCTION MemDisposeFixed(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR ioMemory: UNIV Ptr): OSStatus; C;
- {
- * Convenience macros
- }
- {
- * Variable block support
- }
- FUNCTION MemNewVariable(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
- FUNCTION MemNewVariableClear(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
- FUNCTION MemDisposeVariable(inAllocator: MemAllocatorRef; VAR ioMemory: UNIV Ptr): OSStatus; C;
- FUNCTION MemGetVariableSize(inAllocator: MemAllocatorRef; inMemory: UNIV Ptr; VAR outSize: ByteCount): OSStatus; C;
- FUNCTION MemSizeVariable(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR ioMemory: UNIV Ptr): OSStatus; C;
- {
- * Debugging Support
- }
- FUNCTION MemCheckAllocator(inAllocator: MemAllocatorRef): OSStatus; C;
- FUNCTION MemForceFailure(inAllocator: MemAllocatorRef; inForceFailure: OSStatus): OSStatus; C;
- {$ENDC}
- {$ALIGN RESET}
- {$POP}
-
- {$SETC UsingIncludes := MemAllocatorsIncludes}
-
- {$ENDC} {__MEMALLOCATORS__}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-